﻿using System;
using System.Collections.Generic;
using System.Text;

namespace GPriceTransferCMD
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {

                switch (args[0].ToLower())
                {
                    case "/showdialog":
                        GPriceTransfer.Transfer tr = new GPriceTransfer.Transfer();
                        System.Windows.Forms.Form frm = (System.Windows.Forms.Form)tr;
                        frm.ShowDialog();
                        break;
                    case "/auto":
                        //GPriceTransfer.Transfer 
                        tr = new GPriceTransfer.Transfer();
                        tr.ProcessAllData();
                        break;
                    case "/delete":
                        //GPriceTransfer.Transfer 
                        tr = new GPriceTransfer.Transfer();
                        tr.DeleteAllData();
                        break;
                    case "/help":
                        ShowHelpCommand();
                        break;
                }
            }
            else
            {
                ShowHelpCommand();
            }
        }
        private static void ShowHelpCommand()
        {
            Console.WriteLine("GPriceTransferCMD usage:");
            Console.WriteLine("GPriceTransferCMD.exe [method]");
            Console.WriteLine("     Method must be the following:");
            Console.WriteLine("           /showdialog : show the winform UI");
            Console.WriteLine("           /auto : process all collect data");
            Console.WriteLine("           /delete : delete all data");
            Console.WriteLine("           /help : show help command");

        }
    }
    
}
